package org.eclipse.football;

import static org.junit.Assert.*;

import org.junit.Test;

public class DuplicateTeams {

	@Test
	public void test() {
		// Instantiate a League
		League league = new League("does_not_exist.txt");
		
		// Create two teams with identical names
		Team team1 = new Team("name","user");
		Team team2 = new Team("name","user");
		
		// Get current number of teams in league
		int old_size = league.getTeams().size();
		
		// Try to add both teams to league
		league.addTeam(team1);
		league.addTeam(team2);
		
		// Make sure that size of league has not increased by 2
		if(league.getTeams().size() == old_size + 2){
			// If not then fail
			fail("League allowed duplicate teams to be added");
		}
	}

}
